|
eeprom16 2.2.1
|
API for configuring and manipulating EEPROM 16 Click driver. More...
Topics | |
| EEPROM 16 Registers List | |
| List of registers of EEPROM 16 Click driver. | |
| EEPROM 16 Registers Settings | |
| Settings for registers of EEPROM 16 Click driver. | |
| EEPROM 16 MikroBUS Map | |
| MikroBUS pin mapping of EEPROM 16 Click driver. | |
Functions | |
| void | eeprom16_cfg_setup (eeprom16_cfg_t *cfg) |
| EEPROM 16 configuration object setup function. | |
| err_t | eeprom16_init (eeprom16_t *ctx, eeprom16_cfg_t *cfg) |
| EEPROM 16 initialization function. | |
| err_t | eeprom16_default_cfg (eeprom16_t *ctx) |
| EEPROM 16 default configuration function. | |
| err_t | eeprom16_write_opcode (eeprom16_t *ctx, uint8_t opcode) |
| EEPROM 16 write opcode function. | |
| err_t | eeprom16_read_opcode (eeprom16_t *ctx, uint8_t opcode, uint8_t *data_out, uint8_t len) |
| EEPROM 16 read opcode function. | |
| void | eeprom16_set_wp_pin (eeprom16_t *ctx, uint8_t state) |
| EEPROM 16 set WP pin function. | |
| void | eeprom16_set_hold_pin (eeprom16_t *ctx, uint8_t state) |
| EEPROM 16 set HOLD pin function. | |
| err_t | eeprom16_enable_write (eeprom16_t *ctx) |
| EEPROM 16 enable write function. | |
| err_t | eeprom16_disable_write (eeprom16_t *ctx) |
| EEPROM 16 disable write function. | |
| err_t | eeprom16_set_block_protection (eeprom16_t *ctx, uint8_t block_protect) |
| EEPROM 16 set block protection function. | |
| err_t | eeprom16_write_status (eeprom16_t *ctx, uint8_t status) |
| EEPROM 16 write status function. | |
| err_t | eeprom16_read_status (eeprom16_t *ctx, uint8_t *status) |
| EEPROM 16 read status function. | |
| err_t | eeprom16_memory_write (eeprom16_t *ctx, uint16_t address, uint8_t *data_in, uint8_t len) |
| EEPROM 16 memory write function. | |
| err_t | eeprom16_memory_read (eeprom16_t *ctx, uint16_t address, uint8_t *data_out, uint16_t len) |
| EEPROM 16 memory read function. | |
API for configuring and manipulating EEPROM 16 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void eeprom16_cfg_setup | ( | eeprom16_cfg_t * | cfg | ) |
EEPROM 16 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See eeprom16_cfg_t object definition for detailed explanation. |
| err_t eeprom16_default_cfg | ( | eeprom16_t * | ctx | ) |
EEPROM 16 default configuration function.
This function executes a default configuration of EEPROM 16 Click board.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_disable_write | ( | eeprom16_t * | ctx | ) |
EEPROM 16 disable write function.
This function disables write by issuing the WRDI command and checking the WEL bit.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_enable_write | ( | eeprom16_t * | ctx | ) |
EEPROM 16 enable write function.
This function enables write by issuing the WREN command and checking the WEL bit.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_init | ( | eeprom16_t * | ctx, |
| eeprom16_cfg_t * | cfg ) |
EEPROM 16 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See eeprom16_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_memory_read | ( | eeprom16_t * | ctx, |
| uint16_t | address, | ||
| uint8_t * | data_out, | ||
| uint16_t | len ) |
EEPROM 16 memory read function.
This function reads a desired number of data bytes starting from the selected memory address.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | address | : Starting memory address [0x0000-0x0FFF]. |
| [out] | data_out | : Read data output. |
| [in] | len | : Number of data bytes. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_memory_write | ( | eeprom16_t * | ctx, |
| uint16_t | address, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
EEPROM 16 memory write function.
This function writes a desired number of data bytes starting from the selected memory address.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | address | : Starting memory address [0x0000-0x0FFF]. |
| [in] | data_in | : Data to be written. |
| [in] | len | : Number of data bytes (up to 32 bytes). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_read_opcode | ( | eeprom16_t * | ctx, |
| uint8_t | opcode, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
EEPROM 16 read opcode function.
This function reads a desired number of data bytes from the selected opcode by using SPI serial interface.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | opcode | : Opcode command. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_read_status | ( | eeprom16_t * | ctx, |
| uint8_t * | status ) |
EEPROM 16 read status function.
This function reads the Status register.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [out] | status | : Read data output. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_set_block_protection | ( | eeprom16_t * | ctx, |
| uint8_t | block_protect ) |
EEPROM 16 set block protection function.
This function sets the block protection bits of the Status register.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | block_protect | :
|
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void eeprom16_set_hold_pin | ( | eeprom16_t * | ctx, |
| uint8_t | state ) |
EEPROM 16 set HOLD pin function.
This function sets the HOLD pin logic state.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| void eeprom16_set_wp_pin | ( | eeprom16_t * | ctx, |
| uint8_t | state ) |
EEPROM 16 set WP pin function.
This function sets the Write Protect (WP) pin logic state.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| err_t eeprom16_write_opcode | ( | eeprom16_t * | ctx, |
| uint8_t | opcode ) |
EEPROM 16 write opcode function.
This function writes a desired opcode command byte by using SPI serial interface.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | opcode | : Opcode command. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t eeprom16_write_status | ( | eeprom16_t * | ctx, |
| uint8_t | status ) |
EEPROM 16 write status function.
This function writes a desired data to the Status register.
| [in] | ctx | : Click context object. See eeprom16_t object definition for detailed explanation. |
| [in] | status | : Data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.